<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = [3,6,2,4,1,5];
        // <!-- 倒序 -->
        arr.reverse()
        // <!-- 降序 -->
        arr.sort(function(a,b) {
            // 如果a 大于 b
            if(a > b) {
                // 降
                return -1;
            } else {
                // 升
                return 1;
            }
        });
    </script>
</body>
</html>